<!-- 十大股东持股变动 -->
<template>
    <div class="table w1021">
        <div class="tableTh tableTr flex">
            <span class="tableTd w220 high">变动时间</span>
            <span class="tableTd w90 high">名次</span>
            <span class="tableTd w220 high">股东名称</span>
            <span class="tableTd w130 high">股东性质</span>
            <span class="tableTd w220 high">持股数量（万股）</span>
            <span class="tableTd w130 high">持有比例（％）</span>
            <span class="tableTd w220 high">较上期增减持数量（万股）</span>
            <span class="tableTd w220 high">变动原因</span>
        </div>
        <div class="tableTr tableBody top flex" v-for="(item, index) in data" :key="index">
            <span class="orange tableTd w220 high">
                {{ item.endDate }}
            </span>
            <span class="orange tableTd w90 high">{{ item.rank | filterVal }}</span>
            <span class="orange tableTd w220 high">{{ item.name | filterVal }}</span>
            <span class="orange tableTd w130 high">
                {{ item.shrHldType | filterVal }}</span>
            <span class="orange tableTd w220 high">
                {{ item.holdNum | filterVal("wy") }}</span>
            <span class="orange tableTd w130 high">
                {{ item.holdPct | filterVal("no") }}</span>
            <span
              class="orange tableTd w220 high"
              :class="item._inrDecNumClass"
            >{{item.inrDecNum|filterVal("num")}}</span>
            <!-- <span class="orange tableTd w220 high" :class="item._inrDecNumClass">
                {{ item.inrDecNum }}
            </span> -->
            <span class="orange tableTd w220 high">
                {{ item.chngReasName | filterVal }}
            </span>
        </div>
        <div class="tableNone orange w1021 top" v-if="data.length == 0">
            暂无数据
        </div>
    </div>
</template>

<script>
import {numberNo, number} from "../../script/api";

export default {
    data() {
        return {};
    },
    props: ["data"],
    filters: {
        filterVal(ops, num) {
            if (num == "num" && ops != "新进" && ops != "不变") {
                if (ops == "") return "--";
                const demo = Number((ops / 10000).toFixed(2)).toLocaleString();
                const main = demo.indexOf("-") != -1 ? demo : "+" + demo;
                return main.indexOf(".") != -1 ? main : main + ".00";
            }
            if (num == "wy") {
                return number(ops, num, 10000);
            }
            if (num == "no") {
                return numberNo(ops, num);
            }
            return ops ? ops : "--";
        }
    }
};
</script>
<style lang="scss" scoped></style>
